package Eyjafjalla.modifier;

import Eyjafjalla.helper.StringHelper;
import Eyjafjalla.modcore.EyjafjallaTag;
import Eyjafjalla.patch.CloudPatch;
import basemod.abstracts.AbstractCardModifier;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.core.Settings;
import com.megacrit.cardcrawl.helpers.GameDictionary;
import com.megacrit.cardcrawl.localization.LocalizedStrings;
import com.megacrit.cardcrawl.localization.UIStrings;
import org.apache.commons.lang3.StringUtils;

public class HeartMod extends AbstractCardModifier {
    public static String ID = "eyjafjalla:HeartMod";
    private static final UIStrings uiStrings;

    public HeartMod(){}

    @Override
    public boolean shouldApply(AbstractCard card) {
        return !card.hasTag(EyjafjallaTag.HEART_EYJAFJALLA);
    }

    @Override
    public void onInitialApplication(AbstractCard card) {
        card.tags.add(EyjafjallaTag.HEART_EYJAFJALLA);
    }

    @Override
    public void onRemove(AbstractCard card) {
        card.tags.remove(EyjafjallaTag.HEART_EYJAFJALLA);
    }

    @Override
    public AbstractCardModifier makeCopy() {
        return new HeartMod();
    }

    @Override
    public String modifyDescription(String rawDescription, AbstractCard card) {
        return  rawDescription + " NL " + uiStrings.TEXT[2] + (Settings.lineBreakViaCharacter ? " " : "") + LocalizedStrings.PERIOD;
    }

    @Override
    public String identifier(AbstractCard card) {
        return ID;
    }

    static {
        uiStrings = CardCrawlGame.languagePack.getUIString(StringHelper.SPECIAL_DESCRIPTION);
    }
}

